-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update for Chart.JS 3.x Support #125
base: master
Are you sure you want to change the base?
Conversation
@lincolnthree I think this PR doesn't work with Chart.js 3.0.0 beta. To register the plugin, the call is changed: Chart.register(plugin); instead of Chart.plugins.register(plugin); Furthermode the multilabels does not work because they are configured as an array. See issue #7754 in Chart,js. With the current code, the In my plugin code, I have changed, taking the configuration from chart instance instead of using the option argument, like that: beforeDatasetsUpdate: function (chart) {
if (!SUPPORTED_TYPES[chart.config.type]) {
return;
}
const optionParams = chart.options.plugins.labels;
var options = optionParams;
if (!Array.isArray(optionParams)) {
options = [optionParams];
}
....
.... |
That's probably right, since this PR was created before the .beta was released :) And since it doesn't seem like it's going to be merged, care to send a PR to my branch? I can pull it in and update it, which will also update this PR. |
Hey folks! Would love to see v3 support being merged and released. What's the current blocker and how can we help it? |
@emn178 I don't want to be rude; I'm just curious: are you still maintaining the product available to review this PR maybe so that we can know what to collectively work on to get it merged and released with ChartJS v3 support? Would be awesome! :) Thanks! |
@lincolnthree is this branch working for you in production right now? It doesn't seem to work for me, but I have a weird setup with ChartjsNodeCanvas so it might totally be due to something in my setup. |
@jipiboily No. The v3 pre-release branch in my PR is no longer compatible and requires more changes to become current with Chart.is 3.x release. |
Thanks for the reply @lincolnthree. I'll see if / when I can get to figure this out. I'll update here if / when that happens. Or did you find another plugin that works with v3 and does something similar? |
It doesn't seem to work, even using this PR and the changes proposed by @stockiNail in his first comment. edit: made it work #140 |
@DavideViolante, thank you for updating the plugin! This: |
Thanks for pointing this out @dana-mb |
First, great plugin, thank you!
This pull request updates this library for support of the upcoming Chart.JS 3.x release (currently in alpha.)
See documentation here:
https://www.chartjs.org/docs/next/getting-started/v3-migration